home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
LineItem.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-04-27
|
805b
|
44 lines
#ifdef __GNUG__
#pragma implementation
#endif
#include "LineItem.h"
#include "Class.h"
//---- LineItem ----------------------------------------------------------------
NewMetaImpl(LineItem,VObject, (TB(dir)));
LineItem::LineItem(bool d, int lw, int ml, int id) : VObject(id)
{
dir= d;
lineWidth= lw;
minLength= ml;
}
Metric LineItem::GetMinSize()
{
if (dir)
return Metric(minLength, lineWidth);
return Metric(lineWidth, minLength);
}
void LineItem::Draw(Rectangle)
{
GrPaintRect(contentRect, Enabled() ? ePatBlack : ePatGrey50);
}
OStream& LineItem::PrintOn (OStream& o)
{
VObject::PrintOn(o);
return o <<lineWidth SP << minLength SP << dir NL;
}
IStream& LineItem::ReadFrom(IStream& i)
{
VObject::ReadFrom(i);
return i >> lineWidth >> minLength >> Bool(dir);
}